package com.hwadee.teachingprocessmanagementsystem.dto.student;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 学生课表传输对象
 * @Author: Jukomu
 * @Package: com.hwadee.teachingprocessmanagementsystem.dto.student
 * @Project: TeachingProcessManagementSystem
 * @name: StudentScheduleInfoDto
 * @Date: 2024/7/14-13:13
 * @Filename: StudentScheduleInfoDto
 */
@Data
public class StudentScheduleInfoDto implements Serializable {
    // 课表信息
    private List<ScheduleInfo> schedules;

    /**
     * 添加一条课表信息
     * @param scheduleInfo
     */
    public void addScheduleInfo(ScheduleInfo scheduleInfo) {
        if (this.schedules == null) {
            this.schedules = new ArrayList<ScheduleInfo>();
        }
        this.schedules.add(scheduleInfo);
    }

    /**
     * 添加一条课表信息
     * @param courseName
     * @param weeks
     * @param date
     * @param time
     * @param teacherName
     * @param campus
     * @param location
     */
    public void addScheduleInfo(String courseName, String weeks, String date, String time, String teacherName, String campus, String location) {
        ScheduleInfo scheduleInfo = new ScheduleInfo();
        scheduleInfo.setCourseName(courseName);
        scheduleInfo.setWeeks(weeks);
        scheduleInfo.setDate(date);
        scheduleInfo.setTime(time);
        scheduleInfo.setTeacherName(teacherName);
        scheduleInfo.setCampus(campus);
        scheduleInfo.setLocation(location);
        addScheduleInfo(scheduleInfo);
    }

    /**
     * 获取单条课表记录
     * @return
     */
    public ScheduleInfo getScheduleInfo() {
        return new ScheduleInfo();
    }
}

/**
 * 课表信息
 */
@Data
class ScheduleInfo implements Serializable {
    // 课程名
    private String courseName;
    // 周次
    private String weeks;
    // 星期
    private String date;
    // 节次
    private String time;
    // 教师名
    private String teacherName;
    // 校区
    private String campus;
    // 地点
    private String location;
}

